package org.fing.edu.uy.admin.managers;

import java.io.InputStream;
import java.sql.SQLException;
import java.util.List;

import org.fing.edu.uy.esbadp.core.AdpFlowTree;
import org.fing.edu.uy.esbadp.core.entity.DMRegisteredService;
import org.fing.edu.uy.esbadp.core.entity.KeyValuePair;
import org.fing.edu.uy.esbadp.core.entity.MetaDataConfig;

public interface IMgrServiceManager {

	/**
	 * 
	 * @param serviceId
	 * @return
	 */
	public List<DMRegisteredService> getEquivalentsServices(Long serviceId)  throws Exception ;
	
	
	/**
	 * 
	 * @return todos los servicios registrados
	 * @throws SQLException
	 */
	
	public DMRegisteredService getVirtualService(Long serviceId) throws Exception;
	
	public List<DMRegisteredService> getAllVirtualServices()  throws Exception;
	
	public MetaDataConfig getVirtualServiceMetadata(Long serviceID) throws Exception;
	
	public int persistVirtualService(DMRegisteredService virtualService) throws Exception;
	
	public void persistVirtualServiceMetadata(MetaDataConfig meta, Long serviceID) throws Exception;
	
	public void persistEquivVirtualServices(List<DMRegisteredService> equiv, Long serviceID) throws Exception;
	
	public int deleteEquivRelation(Long serviceID) throws Exception;
	
    public int deleteVirtualServiceMetadata(String metaKey , Long serviceID) throws Exception;
	
	public int deleteVirtualService(Long serviceID) throws Exception;
	
    public int updateService(DMRegisteredService virtualService) throws Exception;
	
    public int updateMetadata(KeyValuePair meta, Long serviceID) throws Exception;
	
	public void addToCanonicalXLST(InputStream inputstream, Long serviceID) throws Exception ;
    
	public void addFromCanonicalXLST(InputStream inputstream, Long serviceID) throws Exception;
	
	public String getToCanonicalXLST(Long serviceID) throws Exception;
	
	public String getFromCanonicalXLST(Long serviceID) throws Exception;
	
    public AdpFlowTree getFlowTreeForService(Long serviceID) throws Exception;
    
    public List<AdpFlowTree> getHistoricFlowTreeForService(Long serviceID ) throws Exception;

	public void clearHistoricFlowTreeForService(Long serviceID) throws Exception;
	
}
